#ifndef __RGBLCD_H
#define __RGBLCD_H

#include "system.h"

#define SPI_SCLK_PORT		  GPIOP
#define SPI_SCLK_PIN	    PIN23

#define SPI_SDA_PORT	    GPIOP
#define SPI_SDA_PIN		    PIN18

#define SPI_CS_PORT	      GPIOM
#define SPI_CS_PIN		    PIN18

#define LCD_BL_PORT		    GPIOB
#define LCD_BL_PIN			  PIN12

#define LCD_RESET_PORT	  GPIOM
#define LCD_RESET_PIN		  PIN18





#define 	SPI_SCLK_H   GPIO_SetBit(SPI_SCLK_PORT,SPI_SCLK_PIN)//SCLK
#define 	SPI_SCLK_L   GPIO_ClrBit(SPI_SCLK_PORT,SPI_SCLK_PIN)

#define 	SPI_SDA_H    GPIO_SetBit(SPI_SDA_PORT,SPI_SDA_PIN)//SDA
#define 	SPI_SDA_L    GPIO_ClrBit(SPI_SDA_PORT,SPI_SDA_PIN)

#define 	SPI_CS_H     GPIO_SetBit(SPI_CS_PORT,SPI_CS_PIN)//CS
#define 	SPI_CS_L     GPIO_ClrBit(SPI_CS_PORT,SPI_CS_PIN)

#define 	LCD_BL_H     GPIO_SetBit(LCD_BL_PORT,LCD_BL_PIN)//BL
#define 	LCD_BL_L     GPIO_ClrBit(LCD_BL_PORT,LCD_BL_PIN)

#define 	LCD_RESET_H  GPIO_SetBit(LCD_RESET_PORT,LCD_RESET_PIN)//RESET
#define 	LCD_RESET_L  GPIO_ClrBit(LCD_RESET_PORT,LCD_RESET_PIN)




void spi_write(uint8_t data,uint8_t mode);

void lcd_memory_init(void);
void lcd_rgb_init(void);



#endif //__DEV_RGBLCD_H__

